from random import choice

def pass_gen(length):
    chars = "#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
    passwd = ""
    for i in range(length):
        passwd = passwd + choice(chars)
    return passwd

def main():
    length = int(input("Enter password length: "))
    print("password: ",pass_gen(length=length))   

if __name__ == "__main__":
    main()
